package io.renren.modules.udp.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.modules.udp.dao.R5rmObjectsDao;
import io.renren.modules.udp.entity.R5rmDeviceEntity;
import io.renren.modules.udp.entity.R5rmObjectsEntity;
import io.renren.modules.udp.service.R5rmObjectsService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

@Service("r5rmObjectsService")
public class R5rmObjectsServiceImpl extends ServiceImpl<R5rmObjectsDao, R5rmObjectsEntity> implements R5rmObjectsService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String key = (String)params.get("key");
        Page<R5rmObjectsEntity> page = this.selectPage(
                new Query<R5rmObjectsEntity>(params).getPage(),
                new EntityWrapper<R5rmObjectsEntity>().like(StringUtils.isNotBlank(key),"objNumber", key)
        );

        return new PageUtils(page);
    }

}
